File System - Dataset to CSV

Declaration

<AMFILESYSTEM ACTIVITY="dataset_to_csv" DESTINATION="C:\temp\Archive\dest.csv" 
RESULTDATASET="myDataset" DELIMITER="semi_colon" 
OVERWRITE="YES" />

Description: Retrieves data currently populated in a dataset and outputs the data onto a comma-separated values (CSV) file.

Practical Usage

Used to the movement of data between programs that natively operate on incompatible (often proprietary) formats. For example, a user may need to transfer data previously populated onto a dataset (with the use of the CSV to dataset activity), and output the data onto a new CSV file.

General Parameters

Property

Type

Required

Default

Markup

Description

Dataset

Text

Yes

(Empty)

RESULTDATASET="myDataset"

The name of the dataset from which to extract data.

Destination

Text

Yes

(Empty)

DESTINATION="c:\temp\file.csv"

The path and filename of the .csv file in which to output the data. This can be a fully qualified path and filename (preferred) or a /filename only (requires use of the Change Folder activity).

Overwrite if file already exists

Yes/No

No

No

OVERWRITE="YES"

If set to YES, matching destination files will be overwritten. If set to NO (default), matching files will not be overwritten, however, a runtime error will occur when a matching file exists.

Advanced Parameters

Property

Type

Required

Default

Markup

Description

Include column names

Yes/No

No

Yes

INCLUDECOLUMNNAMES="NO"

If set to YES, will treat the first line of the CSV data as column headers. If set to NO, column headers are ignored.

Delimiter

Text (options)

Yes

Comma

  1. DELIMITER="semicolon"

  2. DELIMITER="tab"

  3. DELIMITER="space"

  4. DELIMITER="custom"

The character to be used to separate the tabular values once they are extracted to the .csv file. The available options are:

  • Comma (default) - A comma is used as a delimiter.

  • Semicolon - A semicolon is used as a delimiter.

  • Tab - A tab is used as a delimiter.

  • Space - A space character is used as a delimiter.

  • Custom - Displays the "Custom delimiter text" field in which to specify a single custom character or custom set of characters to use as delimiter.

Description tab - A custom description can be provided on the Description tab to convey additional information or share special notes about a task step.

Error Causes tab - Specify how this step should behave upon the occurrence of an error. (Refer to Task Builder > Error Causes Tab for details.)

On Error tab - Specify what AWE should do if this step encounters an error as defined on the Error Causes tab. (Refer to Task Builder > On Error Tab for details.)

Example

NOTE: In order for this task to work, please modify the SOURCE and DESTINATION to locations that are applicable to your system.
<AMFILESYSTEM ACTIVITY="get" MODE="folder" 
SOURCE="C:\temp" RESULTDATASET="theFolderInfo" 
FILEPROPERTY="fullname" />
<AMFILESYSTEM ACTIVITY="dataset_to_csv" 
DESTINATION="c:\temp3\theFolderInfo.csv" 
RESULTDATASET="theFolderInfo" 
OVERWRITE="YES" />